package com.mingqijia.gassafety.shared.constant;

import java.util.HashMap;
import java.util.Map;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * 系统常量定义
 *
 * @author Damon S.
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Constants {
    //数据库数据状态
    public static final int IS_DELETED_FALSE = 0;
    public static final int IS_DELETED_TRUE = 1;
    public static final String STR_EMPTY = "";
    public static final String STR_NA = "NA";
    public static final String STR_ON = "on";
    public static final String STR_OFF = "off";

    public static final String STR_CODE = "code";
    public static final String STR_TYPE = "type";
    public static final String STR_TOKEN = "token";
    public static final String STR_APPID = "appid";
    public static final String STR_SECRET = "secret";
    public static final String STR_TYPE_CREDENTIAL = "client_credentials";
    public static final String STR_TYPE_TOKEN = "third_token";
    /**
     * 删除线-中划线
     */
    public static final String STR_STRIKETHROUGH = "-";
    public static final String STR_SHARP = "#";
    public static final String STR_AND = "&";
    public static final String STR_COMMA = ",";
    public static final String STR_DOT = ".";
    public static final String STR_SLASH = "/";
    public static final String STR_ONE = "1";
    public static final String STR_MINUS_ONE = "-1";
    public static final String DEFAULT_PWD = "666666";
    /** 中文分隔符 */
    public static final String CHINESE_SPLITOR = "，";
    /** 百分号 */
    public static final String PERCENT = "%";
    /** 下划线 */
    public static final String UNDERLINE = "_";
    /** 空白 */
    public static final String BLANK = "";

    /** 空格 */
    public static final String SPACE = " ";

    public static final String HEADER_BLANK = "      ";
    /** 气体浓度 */
    public static final String CONCENTRATION = "%LEL";
    public static final String LEFT_BRACKET = "(";
    public static final String RIGHT_BRACKET = ")";

    public static final int CODE_GAS_AUTH_FAILED = 10001;

    /**
     * 平台企业
     */
    public static final String PLATFORM_SP = "0";
//    public static final String PLATFORM_SP = "ENT_GSS1666666";
    /**
     * 平台管理员
     */
    public static final String PLATFORM_SA = "USER_SA1666666";
    /**
     * 平台管理员角色
     */
    public static final String PLATFORM_SR = "ROLE_PA1666666";
    public static final String PLATFORM_UN = "SuperAdmin";

    public static final String DEPARTMENT = "department";
    public static final String TEAM = "team";
    public static final String POSITION = "position";

    public static final Long PAGE_SIZE = 10L;
    public static final Integer INT_ZERO = 0;
    public static final Integer INT_ONE = 1;

    public static final Long LONG_ZERO = 0L;
    public static final Long LONG_ONE = 1L;
    public static final Long LONG_1_KILO = 1000L;
    public static final Integer INT_TWO = 2;
    public static final Integer MINUTES_10 = 10;

    public static final String ENV_PROD = "prod|private";

    /*** 日志跟踪id名。*/
    public static final String LOG_TRACE_ID = "traceId";
    /*** 请求头跟踪id名。*/
    public static final String HEADER_SP_ID = "x-sp-id";
    public static final String PATH_ROOT_CONSOLE = "/console";
    public static final String PATH_ROOT_BUSINESS = "/business";
    public static final String TOKEN_URL = "/console/v1/oauth/token";
    public static final String IMEI_CHECK_URL = "/workorder/equipment/checkEquipment";
    public static final String SYNC_ORDER_CHECK_URL = "/workorder/orderComplete";

    public static final String IMAGE_EXT_JPG = "jpg";
    public static final String PREFIX_BEARER = "Bearer ";

    /**
     * 正则表达式
     */
    public static final String REGEXP_ORG = "^[\\w\\u4e00-\\u9fa5]{2,16}$";
    public static final String REGEXP_PHONE = "^1(?:3\\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\\d|9\\d)\\d{8}$";
    public static final String REGEXP_PWD = "^[\\w-\\.!@#\\$%\\\\\\^&\\*\\)\\(\\+=\\{\\}\\[\\]\\/\",'<>~\\·`\\?:;|]{6,20}$";
    public static final String REGEXP_PWD_MD5 = "^[\\da-zA-Z]{32}$";
    /**
     * 2-16位汉字、字母、数字
     */
    public static final String REGEXP_NAME = "^[\\w\\u4e00-\\u9fa5]{0,16}$";
    public static final String REGEXP_USERNAME = "^[a-zA-Z_]\\w{1,15}$";
    public static final String REGEXP_URL = "^[\\d\\w-\\.!@#\\$%\\\\\\^&\\*\\)\\(\\+=\\{\\}\\[\\]\\/\",'<>~\\·`\\?:;|]{1,2000}$";
    public static final String REGEXP_RUNNING_REPORT_HEADER_TITLE = "^[\\w\\u4e00-\\u9fa5]{2,14}$";
    /**
     * 配置项key字段
     */
    public static final String CACHE_KEY_FUNC_CODE = "func_code";
    public static final String CACHE_KEY_TOKEN_EXPIRY = "token_expiry";
    public static final String CACHE_KEY_TOKEN_REFRESH = "token_refresh";
    public static final String CACHE_KEY_CAPTCHA_EXPIRY = "captcha_expiry";
    public static final String CACHE_KEY_CHANGE_PWD = "force_change_pwd";
    public static final String CACHE_KEY_CONFIGURE = "config_param";
    public static final String CACHE_KEY_DICTIONARY = "config_dict";
    public static final String CACHE_KEY_DICT_MAP = "config_dict_map";
    public static final String CACHE_KEY_BEN_TOKEN = "benan_token:%s";
    public static final String CACHE_KEY_ORG_NATURE = "org_attr_platform";
    public static final String CACHE_KEY_ORG_TYPE = "org_type_platform";
    public static final String CACHE_KEY_ORG_TYPE_ENT = "org_type_enterprise";
    /**
     * 字典关键项
     */
    public static final String DICTIONARY_PLATFORM = "platform";
    public static final String DICTIONARY_ENTERPRISE = "enterprise";
    public static final String DICTIONARY_SUBSIDIARY = "subsidiary";
    public static final String DICTIONARY_JV_AREA = "jv_area";
    public static final String DICTIONARY_SERVICE_PKG = "service_pkg";
    public static final String DICTIONARY_TWO_SERVICE_PKG = "two_service_pkg";

    /**
     * 缓存键值对名称
     */
    public static final String KEY_MANAGER_CAPTCHA = "manager_captcha:%s";
    public static final String KEY_MANAGE_PROFILE = "manager_profile:%s";

    public static final String KEY_MANAGE_PROFILE_CODE = "manager_profile_code:%s";

    public static final String KEY_H5_USER_PROFILE = "h5_user_profile:%s";
    public static final String KEY_MANAGE_REFRESH_TOKEN = "manager_refresh_token:%s";


    /**
     *故障短信
     */
    public static final String RUNNING_STRATEGY_FAULT = "Fault_ploy_notice";
    /**
     * 离线短信
     */
    public static final String RUNNING_STRATEGY_OFFLINE = "Offline_ploy_notice";
    /**
     * 运行报告短信
     */
    public static final String RUNNING_STRATEGY_REPORT = "Run_ploy_notice";
    /**
     * 服务到期提醒
     */
    public static final  String RUNNING_STRATEGY_SERVICE = "Service_ploy_notice";
    /**
     * 预警短信模板
     */
    public static final String WARN_STRATEGY = "Alarm_notice";

    /**
     * 预警短信模板
     */
    public static final String WARN_ALARM_STRATEGY = "alarm_notice";

    /**
     * 报警器-故障首次
     */
    public static final String WARN_Alarm_equipment_fault_no1 = "Alarm_equipment_fault_no1";

    /**
     * 故障短信模板
     */
    public static final String FAULT_ALARM_STRATEGY = "Fault_notice_ploy";

    /**
     * 离线短信模板
     */
    public static final String REST_ALARM_STRATEGY = "Offline_notice_ploy";

    /**
     * 服务到期短信模板
     */
    public static final String SERVICE_ALARM_STRATEGY = "Service_notice_ploy";

    /**
     * 运行报告短信模板
     */
    public static final String RUNNING_ALARM_STRATEGY = "Run_notice_ploy";

    /**
     * 预警微信模板
     */
    public static final String WARN__WX_STRATEGY = "Alarm_equipment_strategy";

    /**
     * 故障微信模板
     */
    public static final String RUNNING__WX_STRATEGY_FAULT = "Alarm_equipment_fault";

    /**
     * 离线微信模板
     */
    public static final String RUNNING__WX_STRATEGY_OFFLINE="Alarm_equipment_off";

    /**
     * 运行报告微信模板
     */
    public static final String RUNNING__WX_STRATEGY_REPORT="Equipment_operation_report";

    /**
     * 服务到期微信模板
     */
    public static final String RUNNING__WX_STRATEGY_SERVICE="Service_expiration_reminder";

    /**
     * 预警短信orgCode
     */
    public static final String ORG_CODE = "Towngas";
    /**
     * 预警微信orgCode
     */
    public static final String ORG_CODE_WX = "SU0105";
    /**
     * 超时时间，15钟
     */
    public static final Long TIME_OUT = 900L;
    /**
     * 超时时间，2小时
     */
    public static final Long TIME_OUT_TWO_HOUR = 7200L;
    /**
     * 更新诉求状态,超时时间 5分钟
     */
    public static final Long APPEAL_TIME_OUT = 300L;

    /**
     * redis预警前缀
     */
    public static final String WARNING_EQUIPMENT = "WARN_EQUIPMENT";

    /**
     * 告警策略执行计数key
     */
    public static final String ALARM_STRATEGY = "alarm_strategy";

    /**
     * redis预警前缀
     */
    public static final String WARNING_EQUIPMENT_RUNNING = "WARN_EQUIPMENT_RUNNING";

    /**
     * redis服务到期提醒
     */
    public static final String WARNING_SERVICE_PERIOD_RUNNING = "WARN_SERVICE_PERIOD_RUNNING";
    /**
     * redis预警前缀
     */
    public static final String WARNING_EQUIPMENT_RUNNING_BREAKDOWN = "WARN_EQUIPMENT_RUNNING_BREAKDOWN";

    /**
     * redis手机号前缀
     */
    public static final String WARNING_PHONE = "WARNING_PHONE";
    /**
     * redis手机号前缀
     */
    public static final String WARNING_PHONE_RUNNING = "WARNING_PHONE_RUNNING";
    /**
     * redis客户前缀
     */
    public static final String WARNING_CONSUMER_RUNNING = "WARNING_CONSUMER_RUNNING";
    /**
     * redis手机号前缀（故障短信）
     */
    public static final String WARNING_PHONE_BREAKDOWN = "WARNING_PHONE_BREAKDOWN";
    /**
     * 定时执行扫描点位设备
     */
    public static final String ADD_EQUIPMENT = "gassafety:job:lock:equipment.autoAddEquipment";
    public static final String STRATEGY_RECORD_STATE_COMMON = "gassafety:job:lock:strategy.record_state_common";
    public static final String STRATEGY_RECORD_SERVICE_PERIOD = "gassafety:job:lock:strategy.record_service_period";
    public static final String STRATEGY_RECORD_STATE_CALL = "gassafety:job:lock:strategy.record_state_call";
    public static final String UPDATE_EQUIPMENT = "gassafety:job:lock:equipment.autoUpdateEquipment";
    public static final String MESSAGE_PUSH = "gassafety:job:lock:message.messagePush";
    /**
     * 更新设备aep激活状态
     */
    public static final String UPDATE_EQUIPMENT_ACTIVATE = "gassafety:job:lock:equipment.updateActivateStatus";
    /**
     * 查询时刻助手工单状态
     */
    public static final String ASST_ORDER_STATUS = "gassafety:job:lock:asst:order:status";
    /**
     * 处理上报数据到history表
     */
    public static final String DEVICE_RECORD_HANDLE = "gassafety:job:lock:device:record:handle";
    /**
     * 注册设备
     */
    public static final String REGISTER_CITY_DEVICE = "gassafety:job:lock:hangzhou.registerCityDevice";
    public static final String CREATE_CITY_PRODUCT = "gassafety:job:lock:hangzhou.createCityProduct";
    public static final String CREATE_CITY_THING_MODEL = "gassafety:job:lock:hangzhou.createCityThingModel";

    /**
     * 大屏2.0数据统计
     */
    public static final String CM_STAT_CONSUMER = "gassafety:job:lock:daping2.consumerStat";
    public static final String CM_STAT_DEVICE = "gassafety:job:lock:daping2.deviceStat";
    public static final String CM_STAT_DEVICE_EXEC_TIME = "gassafety:job:lock:daping2.deviceStatTime";
    public static final String CM_STAT_DEVICE_ALARM = "gassafety:job:lock:daping2.deviceAlarmStat";

    /**
     * 定时执行扫描设备报警
     */
    public static final String EQUIPMENT_WARNING_FIRST = "gassafety:job:lock:equipment.warningFirst";
    public static final String EQUIPMENT_WARNING_REPORT = "gassafety:job:lock:equipment.strategyReport";
    public static final String LOG_LOGIN_RECORD = "gassafety:job:lock:log.login.record";

    public static final String EQUIPMENT_RUNNING_REPORT = "gassafety:job:lock:equipment.runningReport";

    public static final String EQUIPMENT_RUNNING_REPORT_STRATEGY = "gassafety:job:lock:equipment.runningReportStraregy";
    public static final String EQUIPMENT_RUNNING_INSTANTLY_REPORT_STRATEGY = "gassafety:job:lock:equipment.runningInstantlyReportStraregy";

    public static final String EQUIPMENT_RUNNING_SERVICE_PERIOD_STRATEGY = "gassafety:job:lock:equipment.runningServicePeriodStrategy";
    public static final String EQUIPMENT_CREATE_SERVICE_INFO = "gassafety:job:lock:equipment.createServiceInfo";

    /**
     * 定时执行扫描设备周期离线
     */
    public static final String EQUIPMENT_DEVICE_CYCLE_NOTIFICATION = "gassafety:job:lock:equipment.deviceCycleNotification";

    /**
     * 定时执行扫描设备数据
     */
    public static final String DTU_DATA_STATISTIC = "gassafety:job:lock:equipment.dtuDataStatistic";

    /**
     * 定时执行扫描设备记录历史数据
     */
    public static final String DEVICE_RECORD_HISTORY = "gassafety:job:lock:equipment.deviceRecordHistory";

    /**
     * 定时执行扫描设备报警
     */
    public static final String EQUIPMENT_WARNING_AGAIN = "gassafety:job:lock:equipment.warningAgain";
    /**
     * 定时执行扫描设备运行策略
     */
    public static final String EQUIPMENT_RUNNING_AGAIN = "gassafety:job:lock:equipment.runningAgain";
    /**
     * 杭州 ,数据上报
     */
    public static final String SET_CITYDEVICEDATA = "gassafety:job:lock:equipment.setCityDeviceData";

    public static final String SET_CITYDEVICEGENERALDATA = "gassafety:job:lock:equipment.setCityDeviceGeneralData";

    /**
     * 预警-本地消息
     */
    public static final String WARNING_LOCAL_MESSAGES = "设备触发报警策略（type）time name-num 报警浓度值：value %LEL";
    /**
     * 预警-短信
     */
    public static final String WARNING_SMS_MESSAGES = "尊敬的用户，#Time#您的设备报警了，报警浓度值：#value#，设备名称：#EquipmentName# ，安装位置：#position#，设备类型：#Equipmenttype# 。为了您的用气安全，请尽快检查。\n" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "报警状态：#Equipment_status#\n" +
            "\n" +
            "备注：如有需要帮助，请尽快联系#phone# 。\n" +
            "\n" +
            "若已处理请忽略本条信息。";

    /**
     * 预警-短信
     */
    public static final String WARNING_SMS_MESSAGES_REPORT = "【港华燃气】尊敬的客户您好，#Date#燃气报警器设备运行报告已出。详情请至【当地港华燃气微信公众号】燃气服务-报警器，查看【燃气设备运行报告】。\n" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "如果有需要，可联系港华燃气热线#phone#。";
    public static final String RUNNING_SMS_MESSAGES_BREAKDOWN ="【港华燃气】尊敬的客户，您的燃气报警器于#Time#故障了，安装位置：#position#。为了更好的保障您的用气安全，请尽快检查。\n" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "如果发现故障，请尽快联系港华燃气热线#phone#。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    public static final String RUNNING_SMS_MESSAGES_OFFLINE ="【港华燃气】尊敬的客户，您的燃气报警器于#Time#离线了，安装位置：#position#。为了更好的保障您的用气安全，请检查燃气报警器的电源情况或网络连接情况，确保其稳定工作。\n" +
            "户名：#subsName#\n" +
            "户址：#address#\n" +
            "设备编号：#IMEI#\n" +
            "如果有需要，可联系港华燃气热线#phone#。\n" +
            "若已处理请忽略本条信息";

    public static final String RUNNING_SMS_SERVICE_PERIOD ="【港华燃气】尊敬的客户，您的燃气报警器报警服务#verb##Time#服务到期，安装位置：#position#。为了更好的保障您的用气安全，请立即联系燃气公司的服务电话#phone#延续服务。\n" +
            "户名：#subsName#\n" +
            "户址：#address#\n" +
            "设备编号：#IMEI#";
    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_MESSAGES = "报警时间: $[Time]\n"+
            "报警内容: 燃气报警器报警浓度值$[value]\n"+
            "设备编号: $[IMEI]\n"+
            "设备位置: $[address]\n"+
            "所属客户: $[subsName] $[subsCode]";


    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_MESSAGES_OFFLINE = "离线时间：$[Time]\n" +
            "设备编号：$[IMEI]\n" +
            "设备位置：$[address]\n" +
            "用户名称：$[subsName]（$[subsCode]）";

    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_MESSAGES_BREAKDOWN = "报警时间：$[Time]\n" +
            "报警内容：燃气报警器故障\n" +
            "设备编号：$[IMEI]\n" +
            "设备位置：$[address]\n" +
            "所属客户：$[subsName]（$[subsCode]）";
    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_MESSAGES_REPORT = "设备名称：$[Date]设备运行报告\n" +
            "设备位置：$[address]\n" +
            "所属客户：$[subsName]（$[subsCode]）\n"
            ;

    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_SERVICE_PERIOD = "设备名称：报警服务$[verb]$[Time]到期\n" +
            "设备编码：$[IMEI]\n" +
            "设备位置：$[address]\n" +
            "所属客户：$[subsName]（$[subsCode]）\n"
            ;

    /**
     * 微信公众号推送
     */
    public static final String WARNING_WX_DEVICE_OFFLINE = "设备名称：#Time#设备自动离线\n" +
            "设备编码：#IMEI#\n" +
            "设备位置：#address#\n" +
            "所属客户：#subsName#（#subsCode#）\n"
            ;
    /**
     * 外呼模板
     */
    public static final String WARNING_CALL_MESSAGES = "您好，我是#name#燃气公司的智能客服，今天给您来电是因为平台收到您家燃气报警器气体泄漏的报警信息，#address#，请您及时检查，" +
            "若已经处理请忽略。您有需要可以及时拨打#name#燃气公司的热线电话#phone#，" +
            "我们会尽快安排人上门检查。感谢您的接听，祝您生活愉快！";
    public static final String WARNING_CALL_MESSAGES_BREAKDOWN= "您好，我是#name#的智能客服，今天给您来电是因为平台收到您家燃气报警器气体故障的报警信息，#address#，为了更好的保障您的用气安全，请您及时检查，若已经处理请忽略。您有需要可以及时拨打#name#的服务电话#phone#，我们会尽快安排人上门检查。感谢您的接听，祝您生活愉快！";
    public static final String WARNING_CALL_MESSAGES_OFFLINE= "您好，我是#name#的智能客服，今天给您来电是因为平台收到您家燃气报警器气体离线的报警信息，#address#，请检查燃气报警器的电源情况或网络连接情况，确保其稳定工作。若已经处理请忽略。您有需要可以及时拨打#name#的服务电话#phone#，我们会尽快安排人上门检查。感谢您的接听，祝您生活愉快！";
    public static final String WARNING_CALL_MESSAGES_REPORT= "您好，我是#name#的智能客服，您位于#address#的#date#燃气报警器设备运行报告已出。详情请至#name#的微信公众号-燃气服务-燃气泄漏报警中查看【燃气设备运行报告】。感谢您的接听，祝您生活愉快！";
    public static final String WARNING_CALL_SERVICE_PERIOD= "您好，我是#name#的智能客服，今天给您来电是因为您家位于#address#的燃气报警器报警服务#verb##date#到期。为了更好的保障您的用气安全，请立即联系燃气公司的服务电话#phone#延续服务。感谢您的接听，祝您生活愉快！";

    
    public static final Map<String,String> ROBOT_CONTENT_KEY_MAP = new HashMap<String,String>(){
        {
            put("#燃气公司名#", "#name#");
            put("#安装地址#", "#address#");
            put("#公司电话#", "#phone#");
            put("#日期#", "#date#");
            put("#服务到期日期#", "#date#");
            put("#动词#", "#verb#");
            put("#厂家名称#", "#factoryName#");
        }
    };
    public static final String ROBOT_ID_FORAN = "20041321";
    public static final String ROBOT_ID_20041321 = "您好，我是#燃气公司名#的智能客服，今天给您来电是因为平台收到您家燃气报警器气体泄漏的报警信息，地址是在#安装地址#，请您关闭燃气总阀门，打开窗户保持通风，不要开关任何电器，及时检查燃气设施是否存在漏气，若已经处理请忽略。您有需要可以及时拨打#燃气公司名#的服务电话#公司电话#，我们会尽快安排人上门检查。感谢您的接听，祝您生活愉快！";
    
    /**
     * 设备厂商字典code
     */
    public static final String MANUFACTURER_CODE = "Equipment_manufacturer";
    /**
     * 设备通讯方式字典code
     */
    public static final String COMMUNICATION_Mode_CODE = "Communication_mode";
    /**
     * 设备运营商字典code
     */
    public static final String OPERATOR_CODE = "Operator";
    /**
     * 设备检测类型字典code
     */
    public static final String DETECTION_TYPE_CODE = "Detection_type";
    /**
     * 本安气体报警控制器设备类型
     */
    public static final Integer DTU_TYPE_CONTROLLER = 5;

    /**
     * 行业类型 字典code
     */
    public static final String INDUSTRY_TYPE_CODE = "industry_type";
    /**
     * 电磁阀厂家字典code
     */
    public static final String VALVE_MANUFACTURER = "solenoid_valve_manufacturer";

    /**
     * 设备类型code
     */
    public static final String EQUIPMENT_TYPE_CODE = "Equipment_type";
    /**
     * 组织数据汇总字典code
     */
    public static final String ORG_SUMMARY_CODE = "org_data_summary";
    /**
     * 电磁阀厂家code
     */
    public static final String VALVE_MANUFACTURE_CODE = "solenoid_valve_manufacturer";

    /**
     * 燃气报警控制器
     */
    public static final String GAS_ALARM_CONTROLLER = "Gas_alarm_controller";

    /**
     * 联系人级别
     */
    public static final String CONTACT_LEVEL = "Contact_level";
    /**
     * 联系人修改开关 字典code
     */
    public static final String TCIS_CONTACTS_UPDATE = "TCIS_Phone_update";

    /**
     * 燃气户号接口映射字典code
     */
    public static final String ORG_MAP_SUBSCODE = "org_map_subsCode";

    /**
     * 第三方系统企业ID映射
     */
    public static final String THREE_QUOTIENT_COMPANY = "three_quotient_company";

    /**
     * redis topic
     */
    public static final String TOPIC_WEBSOCKET = "topic:webSocket";

    /**
     * dp redis topic
     */
    public static final String TOPIC_DP_WEBSOCKET = "topic:webSocketDp";

    /**
     * 工商业大屏 redis topic
     */
    public static final String TOPIC_USER_WEBSOCKET = "topic:webSocketUser";

    /**
     * redis topic
     */
    public static final String TOPIC_ORDER_AUTO_CREATE = "topic:orderAutoCreate";

    /**
     * 报警原因字典
     */
    public static final String ALARM_REASON = "alarm_reason";

    public static final String SMS_DISABLE_STR1 = "【";
    public static final String SMS_DISABLE_STR2 = "】";

    //设备回路
    public static final String EQUIPMENTI_CONSTANT = "-1-";

    public static final String CONCENTRATION_UNIT = "%LEL";

    /**
     * 探测器上报-探测器状态 0-正常 33-探测器故障, 34-传感器故障, 35-电磁干扰
     */
    public static final Integer DETECTOR_STATUS_NORMAL = 0;
    public static final Integer DETECTOR_STATUS_DETECTOR_FAULT = 33;
    public static final Integer DETECTOR_STATUS_SENSOR_FAULT = 34;
    public static final Integer DETECTOR_STATUS_EMI = 35;

    /**
     * 设备通讯协议版本号
     */
    public static final String PROTOCOL_VERSION_1 = "1";
    public static final String PROTOCOL_VERSION_2 = "2";

    // 设备绑定渠道 ,报警器后台手动, 模板一
    public static final int BIND_CHANNEL_GAS = 1;
    // 设备绑定渠道 , 时刻助手工单自动
    public static final int BIND_CHANNEL_ASST = 2;
    public static final int BIND_CHANNEL_MBP = 3;
    public static final int BIND_CHANNEL_ZJ_WIFI = 4;
    // 设备绑定渠道， TCIS退货解绑ß
    public static final int BIND_CHANNEL_TCIS_REFUND = 5;

    public static final String COCKPIT_TITLE = "cockpit_title";
    public static final String COCKPIT_CONTROL_ORDER = "cockpit_control_order";
    public static final String COCKPIT_WARNING_INFO = "cockpit_warning_info";
    public static final String COCKPIT_WARN_STRATEGY_HIDE = "cockpit_warnStrategy_Hide";


    // t_gas_workorder_history - order_type 模板类型安装单
    public static final int ORDER_TYPE_INSTALL = 1;

    //查询 用户登录记录
    public static final String VCC_OPT_TYPE_LOGIN_IN = "LoginIn";
    public static final String VCC_OPT_TYPE_LOGIN_OUT = "LoginOut";

    //紫荆相关常量
    //紫荆客户类型
    public static final Integer CONSUMER_TYPE_ZJ = 1;
    //紫荆客户前缀
    public static final String CONSUMER_ID_ZJ = "紫荆_";
    //紫荆客户默认行业类型
    public static final String ZJ_INDUSTRY_TYPE = "resident";
    public static final String ZJ_INDUSTRY_TYPE_STR = "居民用户";
    public static final String ZJ_EQUIPMENT_MODEL = "JT-BJ02Di";
    public static final Integer ZJ_EQUIPMENT_FROM = 1;
    public static final String ZJ_DEVICE_NO = "BA-BJ02Di";
    public static final String ZJ_EQUIPMENT_MANUFACTURER = "12";

    public static final String ZJ_RECEIVER_CODE_1 = "BA-BF02";
    public static final String ZJ_RECEIVER_CODE_2 = "BA-BF03";
    public static final String ZJ_RECEIVER_CODE_3 = "BA-BF04";
    //二维码贴错了，本身没有BA-BF01，代码兼容
    public static final String ZJ_RECEIVER_CODE_4 = "BA-BF01";

    //紫荆 阀门故障
    public static final Integer ZJ_VALVE_STATUS = 2;
    //iot 紫荆类型
    public static final Integer ZJ_EQUIPMENT_DEVICETYPE = 9;

    //iot cat
    public static final Integer CAT_EQUIPMENT_DEVICETYPE = 1;
    //iot 联通设备
    public static final Integer UNICOM_EQUIPMENT_DEVICETYPE = 2;

    //iot 电信设备
    public static final Integer TELECOM_EQUIPMENT_DEVICETYPE = 3;
    //iot 移动设备
    public static final Integer MOVE_EQUIPMENT_DEVICETYPE = 0;

    public static final String CMS_SEND_MSG = "App\\Notify.sendMsg";

    public static final String APPLET_SEND_MSG = "App\\Notify.sendMiniappPush";

    public static final String USER_ID_BY_PHONE = "User\\Index.getUserIdByPhone";

    public static final String JSON_RPC = "jsonrpc";

    public static final String JSON_RPC_VERSION = "2.0";

    public static final String RPC_METHOD = "/rpc.php";

    //诉求状态：0待处理 1工单处理中 2已处理 3工单处理完成 4未办结 5已办结 6安装调试 7工单调试 8无需处理
    public static final Integer APPEAL_STATUS_0 = 0;
    public static final Integer APPEAL_STATUS_1 = 1;
    public static final Integer APPEAL_STATUS_2 = 2;
    public static final Integer APPEAL_STATUS_3 = 3;
    public static final Integer APPEAL_STATUS_4 = 4;
    public static final Integer APPEAL_STATUS_5 = 5;
    public static final Integer APPEAL_STATUS_6 = 6;
    public static final Integer APPEAL_STATUS_7 = 7;
    public static final Integer APPEAL_STATUS_8 = 8;


    public static final Integer BIND = 1;
    public static final Integer UNBIND = 0;

    public static final Integer OPERATE_RESULT_SUCCESS = 1;
    public static final String OPERATE_RESULT_SUCCESS_MSG = "成功";

    public static final Integer OPERATE_RESULT_FAIL = 0;
    public static final String OPERATE_RESULT_FAIL_MSG = "失败";

    public static final Integer OPERATE_RESULT_SUCCESS_PART = 2;
    public static final String OPERATE_RESULT_SUCCESS_PART_MSG = "部分成功";

    public static final Integer UNCHECKED = 0;
    public static final Integer CHECKED = 1;
    public static final String CONSUMER_SOURCE_SYSTEM = "系统录入";
    public static final String CONSUMER_SOURCE_ASST = "时刻助手";
    /**
     * mbp 维修处理工单 防重复提交
     */
    public static final String SUBMIT_MBP_WORKERORDER = "gassafty:mbp:lock:wokeroder.submit:";

    /** 小程序跳转地址 */
    public static final String WARNINGDEVICE_DETAIL = "packages/iot/pages/warningDevice/detail/index?imei=%s&homeId=%d&equType=19&deviceId=%s&deviceCode=%s&equName=%s&roomName=%s";

    /** 小程序跳转地址 */
    public static final String RUNNINGREPORT_PREVIEW = "/packages/iot/pages/warningDevice/record/index?imei=%s&reportDate=%s&isForTrial=%s&timeStamp=%s";

    /** h5跳转地址 */
    public static final String RUNNINGREPORT_H5 = "%s/#/warningDevice/history?imei=%s&reportDate=%s&isForTrial=%s&timeStamp=%s";

    /**
     * 设备运行报告-默认页眉logo
     */
    public static final String RUNNING_REPORT_HEADER_LOGO = "https://mall-prod-public-1259300393.cos.ap-beijing.myqcloud.com/gap/3c16b148e02c4e62893968c9266b17e5.png";

    /**
     * 设备运行报告-消息标题
     */
    public static final String RUNNING_REPORT_MESSAGE_TITLE = "设备运行报告通知";

    /**
     * 设备运行报告预览-消息标题
     */
    public static final String RUNNING_REPORT_PREVIEW_MESSAGE_TITLE = "设备运行报告预览通知";

    /**
     * 设备运行报告-发送消息
     */
    public static final String RUNNING_REPORT_SEND_MESSAGE = "您的%s %s设备运行报告已出。详情请至(时刻家APP)智享-我的设备-报警器，查看(设备运行报告)。点击查看报告详情";

    /**
     * 设备运行报告预览-发送消息
     */
    public static final String RUNNING_REPORT_PREVIEW_SEND_MESSAGE = "您的%s设备运行报告已出。此条消息2小时内有效，请在有效期内点击查看报告详情。";

    /**
     * 设备运行报告无报警-默认内容
     */
    public static final String RUNNING_REPORT_NO_ALARM_CONTENT = "尊敬的#subsName#客户:\n" +
            "    您好！感谢您选择我们的服务。根据运行监控记录，您在#Date#未发生任何报警事件，一切都正常运行（仅供您参考）。\n" +
            "    如果您有任何疑问或需要帮助，我们随时待命，竭诚为您服务。请随时联系我们，我们将全心全意为您解答任何问题，确保您的用气安全。\n" +
            "    再次感谢您的信任与支持，我们将一如既往地为您提供最优质的服务。祝您和您的家人生活愉快，用气安全！";

    /**
     * 设备运行报告报警总结-默认内容
     */
    public static final String RUNNING_REPORT_ALARM_SUMMARY_CONTENT = "尊敬的#subsName#客户:\n" +
            "    您好！特为您提供#Date#监控记录，仅供您参考。 如您有任何疑问，请联系我们，我们将竭诚为您服务，祝您安全用气！";

    /**
     * 设备运行报告报警总结-饼图
     */
    public static final String RUNNING_REPORT_ALARM_PIE = "option = {\n" +
            "  title: {\n" +
            "    text: '#name#',\n" +
            "    left: 'center',\n" +
            "    textStyle: {\n" +
            "fontFamily: 'SimSun',\n" +
            "fontSize: 24,\n" +
            "      fontWeight: 'bolder',\n" +
            "      lineHeight: 30\n" +
            "    }\n" +
            "  },\n" +
            "  tooltip: {\n" +
            "    trigger: 'item'\n" +
            "  },\n" +
            "  legend: {\n" +
            "    orient: 'vertical',\n" +
            "    bottom: 10,\n" +
            "    orient: 'horizontal',\n" +
            "    textStyle: {\n" +
            "fontFamily: 'SimSun',\n" +
            "fontSize: 24\n" +
            "    }\n" +
            "  },\n" +
            "  series: [\n" +
            "    {\n" +
            "      name: 'Access From',\n" +
            "      type: 'pie',\n" +
            "      radius: '65%',\n" +
            "      bottom: 0,\n" +
            "      data: [#data#],\n" +
            "      emphasis: {\n" +
            "        itemStyle: {\n" +
            "          shadowBlur: 10,\n" +
            "          shadowOffsetX: 0,\n" +
            "          shadowColor: 'rgba(0, 0, 0, 0.5)'\n" +
            "        }\n" +
            "      }\n" +
            "    }\n" +
            "  ]\n" +
            "};";


    public static final String RUNNING_REPORT_ALARM_BROKEN = " { value: #number#, name: '#name#',label:{fontSize:24,fontFamily: 'SimSun'}, itemStyle: {\n" +
            "                        color: '#color#'\n" +
            "                    } },";

    /**
     * 设备运行报告报警总结-柱状图
     */
    public static final String RUNNING_REPORT_ALARM_BAR = "option = {\n" +
            "  title: {\n" +
            "    text: '#name#' ,\n" +
            "    left: 'center',\n" +
            "    textStyle: {\n" +
            "      fontSize: 24,\n" +
            "      fontFamily: 'SimSun',\n" +
            "      fontWeight: 'bolder'\n" +
            "    }\n" +
            "  },\n" +
            "  xAxis: {\n" +
            "    type: 'category',\n" +
            "    data: [#data#],\n" +
            "    axisLabel: {\n" +
            "      formatter: function (value, index) {\n" +
            "        var texts = ['{a|'+value.substring(0, 2)+'}','{b|'+value.substring(2)+'}'];\n" +
            "        return texts.join('\\n');\n" +
            "      },\n" +
            "      rich: {\n" +
            "        a: {\n" +
            "          color: 'rgba(0,0,0,1)',\n" +
            "          align:'center',\n" +
            "          fontFamily: 'SimSun',\n" +
            "          fontSize: 24\n" +
            "        },\n" +
            "        b: {\n" +
            "          color: 'rgba(0,0,0,0.3)',\n" +
            "          fontFamily: 'SimSun',\n" +
            "          fontSize: 18\n" +
            "        }\n" +
            "      },\n" +
            "      #sort#" +
            "    }\n" +
            "  },\n" +
            "  #grid#\n" +
            "  yAxis: {\n" +
            "    type: 'value'\n" +
            "  },\n" +
            "  series: [\n" +
            "    {\n" +
            "      data: [#value#],\n" +
            "      type: 'bar',\n" +
            "      barWidth: 50\n" +
            "    }\n" +
            "  ]\n" +
            "};";



    /**
     * 设备运行报告报警总结-默认标题
     */
    public static final String RUNNING_REPORT_ALARM_SUMMARY_TITLE = "#subsName#客户燃气报警监控记录报告（#Date#）";

    /**
     * 设备运行报告明细-默认标题
     */
    public static final String RUNNING_REPORT_ALARM_DETAIL_TITLE = "燃气报警记录明细表（#Date#）";

    /**
     * 设备运行报告温馨提示-默认内容
     */
    public static final String RUNNING_REPORT_TIPS_CONTENT = "    再次感谢您的信任与支持，我们将一如既往地为您提供最优质的服务。祝您和您的家人生活愉快，用气安全！";

    /**
     * SP对应的mbp地址
     */
    public static final String SP_MBP_URL = "SP_MBP_URL:";

    /**
<<<<<<< HEAD
     * 区域对应的企业id（sp_id）信息
     */
    public static final String GASSAFETY_REGION_SP_INFO = "GASSAFETY_REGION_SP_INFO";

    /*
     * 预警-短信内容
     */
    public static final String WARNING_SMS_MESSAGES_CONTENT = "【港华燃气】尊敬的用户，今天给您来电是因为您的燃气报警器于#Time#检测到燃气泄漏，设备名称：#Name# ，安装位置：#Position#，设备类型：#Equipmenttype# 为了您的用气安全，请立即开门开窗通风，关闭气源。" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "备注：如有需要帮助，请尽快联系港华燃气抢修热线#phone#  。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    /**
     * 故障-短信内容
     */
    public static final String FAULT_SMS_MESSAGES_CONTENT = "【港华燃气】尊敬的用户，今天给您来电是因为您的燃气报警器于#Time#发生故障了，设备名称：#Name# ，安装位置：#Position#，设备类型：#Equipmenttype# 。为了您的用气安全，请尽快检查。" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "备注：如有需要帮助，请尽快联系港华燃气抢修热线#phone#  。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    /**
     * 离线-短信内容
     */
    public static final String REST_SMS_MESSAGES_CONTENT = "【港华燃气】尊敬的用户，今天给您来电是因为您的燃气报警器于#Time#离线了，设备名称：#Name# ，安装位置：#Position#，设备类型：#Equipmenttype#  。为了更好的保障您的用气安全，请检查燃气报警器的电源情况或网络连接情况，确保其稳定工作。" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "备注：如有需要帮助，请尽快联系港华燃气抢修热线#phone#  。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    /**
     * 服务到期-短信内容
     */
    public static final String SERVICE_SMS_MESSAGES_CONTENT = "【港华燃气】尊敬的用户，今天给您来电是因为您的燃气报警器报警服务#verb#于#Time#服务已到期，设备名称：#Name# ，安装位置：#Position#，设备类型：#Equipmenttype# 。为了更好的保障您的用气安全，请立即联系燃气公司热线#phone#延续服务。" +
            "\n" +
            "户名：#subsName#\n" +
            "\n" +
            "户址：#address#\n" +
            "\n" +
            "设备编号：#IMEI#\n" +
            "\n" +
            "备注：如有需要帮助，请尽快联系港华燃气抢修热线#phone#  。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    /**
     * 运行报告-短信内容
     */
    public static final String RUNNING_SMS_MESSAGES_CONTENT = "【港华燃气】尊敬的用户，今天给您来电是因为您的#Family#设备运行报告于#Time#已出。详情请至(时刻家APP)智享-我的设备-报警器，查看(设备运行报告)。" +
            "\n" +
            "如有需要帮助，可联系港华燃气热线#phone#。\n" +
            "\n" +
            "若已处理请忽略本条信息";

    /*
     * 功能区划分 1：自动 2：自定义划分
     */
    public static final Integer FUNC_AREA_ALLOCAT_AUTO = 1;
    
    public static final Integer FUNC_AREA_ALLOCAT_CUSTOM = 2;


    /**
     * 同步给智慧厨房的设备号rediskey
     */
    public static final String SYNC_ALAM_TO_SK_IMEIS_REDIS_KEY = "GASSAFETY:SYNC_ALAM_TO_SK_IMEIS";

    /**
     * 登陆用户权限字典
     */
    public static final String LOGIN_USER_PERMISSION_REDIS_KEY = "GASSAFETY:USER_PERMISSION";

    /**
     * 供应商缓存
     */
    public static final String EQUIPMENT_MANUFACTURER_REDIS_KEY = "GASSAFETY:MANUFACTURER";

    /**
     * 三商token缓存
     */
    public static final String THREE_QUOTITENT_REDIS_KEY = "GASSAFETY:THREEQUOTITENT";


    public static final Map<String,String> MSG_CODE_CONTENT_MAP = new HashMap<String,String>(){
        {
            //短信
            put(WARN_STRATEGY, WARNING_SMS_MESSAGES); //报警
            put(RUNNING_STRATEGY_FAULT, RUNNING_SMS_MESSAGES_BREAKDOWN); //故障
            put(RUNNING_STRATEGY_OFFLINE, RUNNING_SMS_MESSAGES_OFFLINE); //离线
            put(RUNNING_STRATEGY_SERVICE, RUNNING_SMS_SERVICE_PERIOD); //服务到期
            put(RUNNING_STRATEGY_REPORT, WARNING_SMS_MESSAGES_REPORT); //运行报告 【无需处理】

            put(WARN_Alarm_equipment_fault_no1, ""); //首次故障

            //外呼不成功短信
            put(WARN_ALARM_STRATEGY, WARNING_SMS_MESSAGES_CONTENT);//报警
            put(FAULT_ALARM_STRATEGY, FAULT_SMS_MESSAGES_CONTENT); //故障
            put(REST_ALARM_STRATEGY, REST_SMS_MESSAGES_CONTENT); //离线
            put(SERVICE_ALARM_STRATEGY, SERVICE_SMS_MESSAGES_CONTENT); //服务到期
            put(RUNNING_ALARM_STRATEGY, RUNNING_SMS_MESSAGES_CONTENT); //运行报告

            //微信
            put(WARN__WX_STRATEGY, WARNING_WX_MESSAGES);//报警
            put(RUNNING__WX_STRATEGY_FAULT,WARNING_WX_MESSAGES_BREAKDOWN);//故障
            put(RUNNING__WX_STRATEGY_OFFLINE, WARNING_WX_MESSAGES_OFFLINE);//离线
            put(RUNNING__WX_STRATEGY_REPORT, WARNING_WX_MESSAGES_REPORT);//运行报告
            put(RUNNING__WX_STRATEGY_SERVICE, WARNING_WX_SERVICE_PERIOD);//服务到期

        }
    };

    public static final Map<Integer,String> STRAGEY_TYPE_SMS_MSG_CODE_MAP = new HashMap<Integer,String>(){
        {
            //短信 -1设备报警 0设备故障 1设备离线 2设备运行报告 3服务到期提醒
            put(-1,WARN_STRATEGY); //报警
            put(0,RUNNING_STRATEGY_FAULT); //故障
            put(1,RUNNING_STRATEGY_OFFLINE); //离线
            put(2,RUNNING_STRATEGY_REPORT); //运行报告
            put(3,RUNNING_STRATEGY_SERVICE); //服务到期
        }
    };

    public static final Map<Integer,String> STRAGEY_TYPE_WXTPL_MSG_CODE_MAP = new HashMap<Integer,String>(){
        {
            //微信 -1设备报警 0设备故障 1设备离线 2设备运行报告 3服务到期提醒
            put(-1,WARN__WX_STRATEGY);//报警
            put(0,RUNNING__WX_STRATEGY_FAULT);//故障
            put(1,RUNNING__WX_STRATEGY_OFFLINE);//离线
            put(2,RUNNING__WX_STRATEGY_REPORT);//运行报告
            put(3,RUNNING__WX_STRATEGY_SERVICE);//服务到期
        }
    };

    public static final Map<String,Map<Integer,String>> MSG_TYPE_STRAGEY_TYPE_WXTPL_MSG_CODE_MAP = new HashMap<String,Map<Integer,String>>() {
        {
            put("sms", STRAGEY_TYPE_SMS_MSG_CODE_MAP);//报警
            put("wxtpl", STRAGEY_TYPE_WXTPL_MSG_CODE_MAP);//故障
        }
    };



    /**
     * 时刻助手-报警器独立流程 工单客户类型
     */
    public static final Integer ORDER_CUST_TYPE_DEFAULT = 0;//默认
    public static final Integer ORDER_CUST_TYPE_COMPANY = 1;//1-企业客户
    public static final Integer ORDER_CUST_TYPE_PERSONAL = 2;//2-个人客户


    /**
     * bi token参数
     */
    public static final String BI_TOKEN_KEY = "GASSAFETY:BI_TOKEN_KEY";


    /**
     * 客户类型
     */
    public static final String CUST_TYPE_ENUM = "cust_type_enum";
}
